package com.junmoo.www.app;

import com.alibaba.fastjson.JSON;
import com.junmoo.www.module.system.entity.SysResource;
import com.junmoo.www.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.context.support.SecurityWebApplicationContextUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("app/test")
@Slf4j
public class TestController {

    @GetMapping
    public R page(){
        log.info(JSON.toJSONString(SecurityContextHolder.getContext().getAuthentication().getPrincipal()));
        return R.success("你好");
    }
}
